package com.hzlj.position.config.common.dto.jzJbxxDeviceBind;

import cn.hutool.core.util.ObjectUtil;
import com.fz.common.base.enums.db.ResultField;
import com.fz.common.dict.annotation.Dict;
import com.hzlj.position.config.common.model.JzJbxxConfig;
import com.hzlj.position.config.common.model.JzJbxxDeviceBind;
import com.hzlj.sqjz.jz.common.dto.common.JzCommonQueryResultDTO;
import lombok.Data;
import lombok.ToString;
import lombok.experimental.Accessors;

import java.math.BigDecimal;
import java.util.Date;

/**
 * 设备绑定表(JzJbxxDeviceBind)查询参数DTO
 *
 * @author lifh
 * @date 2023-03-13 16:57:40
 */
@Data
@ToString
@Accessors(chain = true)
public class JzJbxxDeviceBindWithJzJbxxDTO extends JzCommonQueryResultDTO {
    /**
     * 可越界距离，单位KM
     */
    @ResultField(JzJbxxConfig.class)
    private BigDecimal crossDistance;
    /**
     * 免点验标记
     */
    @ResultField(JzJbxxConfig.class)
    private Boolean mdy;

    /**
     * 首次定位时间
     */
    @ResultField(JzJbxxDeviceBind.class)
    private Date firstLocateTime;
    /**
     * 设备号，多个用/隔开
     */
    @ResultField(JzJbxxDeviceBind.class)
    private String deviceCodes;
    /**
     * 渠道，多个用/隔开
     */
    @Dict(value = "LOCATE_CHANNEL", separator = "/")
    @ResultField(JzJbxxDeviceBind.class)
    private String channels;
    /**
     * 渠道文本，多个用/隔开
     */
    private String channelsText;
    /**
     * 是否开通
     */
    private Boolean turnOn;

    public Boolean getTurnOn(){
        return ObjectUtil.isNotEmpty(deviceCodes);
    }
}
